import {
  Component,
  Input,
  TemplateRef,
  ContentChild,
  OnInit,
  AfterViewInit,
} from '@angular/core';

@Component({
  selector: 'apes-header',
  template: `
    <div class="apes-header">
      <div class="headerContainer">
        <div class="buttonList">
          <ng-content #buttonList select=".buttonList"></ng-content>
        </div>

        <div class="statusBar">
          <ng-content #statusBar select=".statusBar"></ng-content>
        </div>
      </div>
    </div>
  `,
})
export class ApesHeaderComponent implements OnInit, AfterViewInit {

  @Input() title: string;     // 测试输入

  paths: any[] = [];

  @ContentChild('buttonList',{static:false}) buttonList: TemplateRef<any>;

  @ContentChild('statusBar',{static:false}) statusBar: TemplateRef<any>;

  constructor() {
  }

  ngOnInit() {
    // 初始化的时候增加样式
    // (this.el.nativeElement as HTMLElement).classList.add('content__title', 'apes-header');
  }

  ngAfterViewInit() {
    // 存在异步延迟等问题,由Css控制
  }
}
